<template>
	<view class="content">
		<image class="logo" src="http://tmp/69mB7jzvSH5B6557fb935014bde7ee796ba42e495ab2.jpeg"></image>

		<button type="balanced" open-type="chooseAvatar" @chooseavatar="onChooseavatar">获取用户头像</button>
		<button @click="loginTap">微信登录</button>
	</view>
</template>

<script setup>
import { apiGetBanner } from '@/api/api.js'
const getClassify = async () => {
	let data = {
		pageNum:1,
		pageSize:100
	}
	const res = await apiGetBanner(data)
	console.log(res)
}
// getClassify()
const onChooseavatar = (e) => {
	
	console.log(e)
}
const loginTap = (e) => {
		
	uni.showModal({
		title:"温馨提示",
		content:"需要获取您的昵称和头像,请授权",
		success: (res) => {
			if (res.confirm) {
				// 需要在小程序进行登录获取code
				uni.login({
					success: (data) => {
						console.log(data)
					}
				})
			}
		}
	})
	

}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
</style>
